/*
 * $Id$
 */
package py.windmill.action;

/**
 *
 * @author myang
 */
public class PathParameter {

    private String _name;
    private String _defaultVal;
    private String _postfix;

    public PathParameter(final String name, final String defaultVal, 
                         final String postfix) {
        _name = name;
        _defaultVal = defaultVal;
        _postfix = postfix;
    }

    public String name() {
        return _name;
    }

    public String defaultVal() {
        return _defaultVal;
    }

    public String postfix() {
        return _postfix;
    }

    public int length() {
        return _name.length() + _defaultVal.length() + _postfix.length() 
          + ("".equals(_defaultVal) ? 2 : 3); //={}
    }

    @Override
    public String toString() {
        return String.format("(%s,%s,%s)", _name, _defaultVal, _postfix);
    }
    
}
